package com.v1.model;

import java.util.Date;

import org.apache.commons.lang.StringUtils;

public class Item extends BaseElement {

	private Integer itemid;
	private Integer score;
	private String name;
	private String url;
	private String thumb;
	private String jsp;
	private String content;
	private Date uploaddate;
	private String digest;
	private Integer type;
	private Integer width;
	private Integer height;
	private String original;

	public String getOriginal() {
		return original;
	}

	public void setOriginal(String original) {
		this.original = original;
	}

	public Integer getType() {
		return type;
	}

	public void setType(Integer type) {
		this.type = type;
	}

	public String getDigest() {
		return digest;
	}

	public void setDigest(String digest) {
		this.digest = digest;
	}

	public String getJsp() {
		return jsp;
	}

	public void setJsp(String jsp) {
		this.jsp = jsp;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public Date getUploaddate() {
		return uploaddate;
	}

	public void setUploaddate(Date uploaddate) {
		this.uploaddate = uploaddate;
	}

	public String getThumb() {
		if (StringUtils.isEmpty(thumb)) {
			return NOT_EXIST_THUMB;
		}
		return thumb;
	}

	public void setThumb(String thumb) {
		this.thumb = thumb;
	}

	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	public Integer getItemid() {
		return itemid;
	}

	public void setItemid(Integer itemid) {
		this.itemid = itemid;
	}

	public Integer getScore() {
		return score;
	}

	public void setScore(Integer score) {
		this.score = score;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public static void main(String[] args) {
		Item name = new Item();
		System.out.println(name.getClass().getName());
	}

	public Integer getWidth() {
		return width;
	}

	public void setWidth(Integer width) {
		this.width = width;
	}

	public Integer getHeight() {
		return height;
	}

	public void setHeight(Integer height) {
		this.height = height;
	}

	@Override
	public String getHref() {
		if (StringUtils.isNotEmpty(href)) {
			return href;
		}
		href = super.getHref();
		if (itemid != null && itemid != 0) {
			href += "&itemid=" + itemid;
		}
		return href;
	}
}
